"""
1.计算列表中大于10的元素的个数
my_list = [5, 10, 15, 20, 25]
"""
# 练习一
# my_list = [5, 10, 15, 20, 25]
#
# count = 0
# for i in my_list:
#     if i > 10:
#         count += 1
# print(count)

"""
2.有两个列表，检查两个列表是否有相同的元素，将相同的元素进行输出
list1 = [1,2,3,4,5]
list2 = [5,6,7,8,9]
"""
# list1 = [1, 2, 3, 4, 5]
# list2 = [5, 6, 7, 8, 9]
#
# common_elements = []
# for i in list1:
#     if i in list2:
#         common_elements.append(i)
# print(common_elements)

"""
3.将列表中所有大于5的元素替换为10
my_list = [3, 8, 2, 7, 6, 4, 9]
"""

my_list = [3, 8, 2, 7, 6, 4, 9]

update_list = []
for i in my_list:
    if i > 5:
        update_list.append(10)
    else:
        update_list.append(i)
print(update_list)
